﻿Public Class ProvidePassword

    Private m_MailboxName As String
    Private m_Agreed As Boolean = False
    Private m_PasswordEnabled As Boolean = True

    Public Property PasswordEnabled() As Boolean
        Get
            Return m_PasswordEnabled
        End Get
        Set(ByVal value As Boolean)
            m_PasswordEnabled = value
        End Set
    End Property

    Public Property Agreed() As Boolean
        Get
            Return m_Agreed
        End Get
        Set(ByVal value As Boolean)
            m_Agreed = value
        End Set
    End Property

    Public Property MailboxName() As String
        Get
            Return m_MailboxName
        End Get
        Set(ByVal value As String)
            m_MailboxName = value
        End Set
    End Property

    Private Sub ProvidePassword_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lblMailbox.Text = "Mailbox: " & m_MailboxName
        txtPassword.Visible = PasswordEnabled
        lblPassword.Visible = PasswordEnabled
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        m_Agreed = True
        Me.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        m_Agreed = False
        Me.Close()
    End Sub
End Class